レプリケートを開始する準備の完了後、ttXlaNextUpdateまたはttXlaNextUpdateWait関数を使用してマスター・データ・ストアから更新レコードを取得し、ttXlaApply関数を使用してサブスクライバ・データ・ストアにレコードを書き込みます。
次に例を示します。
int j;
SQLSMALLINT cbConnStrOut;
int records;
ttXlaUpdateDesc_t ** arry;
do {
/* get up to 15 updates */
rc = ttXlaNextUpdate(xla_handle,&arry,15,&records);
if (rc != SQL_SUCCESS) {
/* 「XLAエラーの処理」を参照*/
}
/* print number of updates returned */
printf("Records returned by ttXlaNextUpdate : %d\n",records);
/* apply the received updates */
for (j=0; j < records; j++) {
ttXlaUpdateDesc_t *p;
p = arry[j];
rc = ttXlaClose(xla_handle);
if (rc != SQL_SUCCESS){
/* 「XLAエラーの処理」 および */
/* 「タイムアウトおよびデッドロックのエラーの処理」 を参照 */
}
}
/* print number of updates applied */
printf("Records applied successfully : %d\n",records);
} while (records != 0);